$slice-0:inset(50% 50% 50% 50%);
$slice-1:inset(80% -6px 0 0);
$slice-2:inset(50% -6px 30% 0);
$slice-3:inset(10% -6px 85% 0);
$slice-4:inset(40% -6px 43% 0);
$slice-5:inset(80% -6px 5% 0);

.wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #F8F005;
}

button,button::after{
  width: 380px;
  height: 86px;
  font-size: 36px;
  font-family: helvetica;
  background: linear-gradient(45deg,transparent 5%,#FF013C 5%);
  border: 0;
  color: #FFF;
  letter-spacing: 3px;
  line-height: 88px;
  box-shadow: 6px 0 0 #00e6f6;
  // 点击时去掉浏览器预设边框
  outline: transparent;
  position: relative;
}
button::after{
  content: 'AVAILABLE NOW';
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(45deg,transparent 3%,#00E6F6 3%,#00E6F6 5%,#FF013C 5%);
  // 文字阴影 左右颜色
  text-shadow: -3px -3px 0 #F8F005, 3px 3px 0 #00e6f6;

  // 图片切割 inset向内缩小
  clip-path: $slice-0;
}

button:hover::after{
  animation: 1s glitch;
  // 数字越小 越钝
  animation-timing-function: steps(2,end);
}

@keyframes glitch {
  0% {
    clip-path: $slice-1;
    transform: translate(-20px, -10px);
  }
  10% {
    clip-path: $slice-3;
    transform: translate(10px, 10px);
  }
  20% {
    clip-path: $slice-1;
    transform: translate(-10px, 10px);
  }
  30% {
    clip-path: $slice-3;
    transform: translate( 0, 5px);
  }
  40% {
    clip-path: $slice-2;
    transform: translate(-5px, 0);
  }
  50% {
    clip-path: $slice-3;
    transform: translate(5px, 0);
  }
  60% {
    clip-path: $slice-4;
    transform: translate(5px, 10px);
  }
  70% {
    clip-path: $slice-2;
    transform: translate(-10px, 10px);
  }
  80% {
    clip-path: $slice-5;
    transform: translate(20px, -10px);
  }
  90% {
    clip-path: $slice-1;
    transform: translate(-10px, 0);
  }
  100% {
    clip-path: $slice-1;
    transform: translate(0);
  }
}